const { BrowserWindow } = require('electron').remote;
const { ipcRenderer } = require('electron');
let btn = document.querySelector("#btnrender");
let btn1 = document.querySelector("#btnrender1");
let btn3 = document.querySelector("#btnrender3");

btn.onclick = function () {
          console.log("this is btn render")
          const win = new BrowserWindow({title:'render'});
}

btn1.onclick = function() {
          ipcRenderer.send('msg-a',{name:'name',sex:'sex'});
}

ipcRenderer.on('msg-b',(event,args)=>{
          console.log('ipcRenderer接收到了msg-b的消息',args);
})

let btn2 = document.querySelector("#btnrender2");
btn2.onclick = function () {
          console.log("this is btn render2")
          const win = new BrowserWindow({title:'render2'});
}

btn3.onclick = function() {
      console.log("渲染进程A-发送给主进程-主进程发送给渲染进程B");
}

console.log("this is render.js");